package com.xjh.basestudy.designmode.createMode.createMode4_AbstractFactory;

/**
 * @author XuJianHua
 * @date 2022-09-23 14:05:30
 * @description 人类兵工厂
 */
public class HumanFactory implements AbstractFactory {

    private int x;//工厂横坐标
    private int y;//工厂纵坐标

    public HumanFactory(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public LowClassUnit createLowClass() {
        LowClassUnit unit = new Marine(x, y);
        System.out.println("制造海军陆战队员成功。");
        return unit;
    }

    @Override
    public MidClassUnit createMidClass() {
        MidClassUnit unit = new Tank(x, y);
        System.out.println("制造变形坦克成功。");
        return unit;
    }

    @Override
    public HighClassUnit createHighClass() {
        HighClassUnit unit = new Battleship(x, y);
        System.out.println("制造巨型战舰成功。");
        return unit;
    }

}